<h3><?php echo $title; ?></h3>

<script type="text/javascript">
    var newwindown;
    function showWindow(order_id)
    {
    	var url = "/admin/order/printer/"+order_id;
        newwindown = window.open(url,"newwindown","menubar=yes,width=520px,height=300px,scrollbars=yes,resizable=no");
		
    }
     function aa()
{
	var url = document.location.href;
	if(url.lastIndexOf("status=0") != -1)
	 document.location.href = url;
}
setInterval("aa()",60000);
    </script>



<?php 
$lang = "vi";
$row=$result;


echo form_open_multipart('admin/order/update/'.$row['order_id']); 

echo '<div style="color:red;text-align:center">';
if(isset($missing))
{
	
foreach ($missing as $item)
{
echo $item."<br />";
}
}

echo "</div>";
?>

<div class="control2">

<?php

	echo form_submit('update', 'Save');
	echo '<input type="button" value="In Hóa Đơn" onClick="showWindow('.$row["order_id"].')" />';
	
	echo form_submit('close', 'Close');

?>

</div><!--control2 end-->



<div class="box">


<div style="text-align:center;font-size:12px;padding:10px;color:#006699"><h2>Thông Tin Đơn đặt hàng</h2> </div>
<div class="inner"style="margin-left:63px;">



<?php


$label ="Tình Trạng: ";

		echo form_label($label);
//echo form_label("Đã Giao Hàng"); echo form_checkbox($data);

?>
  <select id="delivered" name="delivered" validate="required:true, maxlength:2" style="width:150px;" >
	<option value="0" <?php if($row['delivered'] == 0 ) echo "selected='selected'"; ?> > Chưa Giao Hàng </option>
    	<option value="1" <?php if($row['delivered'] == 1 ) echo "selected='selected'"; ?> > Đã Giao Hàng </option>
  </select>
</div>
<?php
		$cus_name = unserialize($row['name']);
			
//		$info = unserialize($row['others_info']);
	
		//title  vi

echo '<div class="inner" style="margin-left:60px;">';
	//$code = "title_vi";
	$label ="Số Hóa Đơn: ";

	//if (! empty($missing) && array_key_exists($code, $missing))

	//	echo form_label($label, '', array('class'=>'error'));

//	else

		echo form_label($label);
//	$data= array( 'name'=>$code,'value'=>html_entity_decode($name['vi'],ENT_QUOTES,"UTF-8"));
//	echo form_input($data, set_value($code));
	echo form_label("#".$row["order_id"]);


	echo '</div>';
	//title en
	
	echo '<div class="inner" style="margin-left:65px;">';
//	$code = "title_en";
	$label ="Họ Tên KH:";

	//if (! empty($missing) && array_key_exists($code, $missing))

		//echo form_label($label, '', array('class'=>'error'));

//	else

		echo form_label($label);
//	$data= array( 'name'=>$code,'value'=>html_entity_decode($name['en'],ENT_QUOTES,"UTF-8"));
//	echo form_input($data, set_value($code));
echo form_label(html_entity_decode($cus_name["full"],ENT_QUOTES,"UTF-8"));
	echo '</div>';




?>
<div style="text-align:center;font-size:12px;padding:10px;color:#006699"><h2>Chi Tiết Đơn Đặt Hàng<?php //$this->lang->line('pages_detail');?></h2> </div>
<div class="inner" >
<table width="700"   border="1" style="margin-left:20px;margin-top:5px;border-spacing:0px">
    <tr style="color:#990000;">
    <!-- 	<th> STT </td>
       <th> Hình ảnh </td> -->
        <th width="250"> Tên Sản Phẩm </td>
        <th width="90"> Giá </td>
        <th width="40"> Số Lượng </td>
        <th width="90"> Thành tiền </td>
        
    
    </tr>

<?php
	foreach ($order_detail as $item)
	{
		$prod_name = unserialize($item["name"]);
		echo "<tr style='border-bottom:1px dotted #fff;line-height:30px;'>";
		//	echo "<td> </td>";
			echo "<td style=''> ".$prod_name[$lang]." </td>";
			echo "<td style='text-align:right'>".number_format($item['price'],0,".",",")." VND </td>";
			echo "<td style='text-align:right'> ".$item['quantity'] ."</td>";
			
			echo "<td style='text-align:right'>  ". number_format($item['sub_total'],0,".",",") ." VND </td>";
		
			echo "</tr>";
	}
	echo "<tr>";
	echo "<td colspan=4 style='text-align:right;line-height:30px;'> ";
	echo "<font color=red> Tông Cộng:". number_format($row["total"],","). "  VND</font>";
	echo "</td>";
	echo "</tr>";
echo "</table>";
echo "</div>";

	
	
	

?>

</div><!--end box-->



<?php

	echo form_close(); //FORM END

?>


<script type="text/javascript">

// This is a check for the CKEditor class. If not defined, the paths must be checked.
if ( typeof CKEDITOR == 'undefined' )
{
	document.write(
		'<strong><span style="color: #ff0000">Error</span>: CKEditor not found</strong>.' +
		'This sample assumes that CKEditor (not included with CKFinder) is installed in' +
		'the "/ckeditor/" path. If you have it installed in a different place, just edit' +
		'this file, changing the wrong paths in the &lt;head&gt; (line 5) and the "BasePath"' +
		'value (line 32).' ) ;
}
else
{

	var editor =		CKEDITOR.replace("detailed_content_vi");
	var editor2 =	CKEDITOR.replace("detailed_content_en");
	
	

	//editor.setData( '<p>Just click the <b>Image</b> or <b>Link</b> button, and then <b>&quot;Browse Server&quot;</b>.</p>' );
	//editor2.setData( '<p>Just click the <b>Image</b> or <b>Link</b> button, and then <b>&quot;Browse Server&quot;</b>.</p>' );
	//editor3.setData( '<p>Just click the <b>Image</b> or <b>Link</b> button, and then <b>&quot;Browse Server&quot;</b>.</p>' );
	// Just call CKFinder.SetupCKEditor and pass the CKEditor instance as the first argument.
	// The second parameter (optional), is the path for the CKFinder installation (default = "/ckfinder/").
	CKFinder.setupCKEditor( editor, '../../../includes/js/ckfinder') ;
	CKFinder.setupCKEditor( editor2, '../../../includes/js/ckfinder' ) ;
	

	// It is also possible to pass an object with selected CKFinder properties as a second argument.
	// CKFinder.SetupCKEditor( editor, { BasePath : '../../', RememberLastFolder : false } ) ;
}

		</script>